package com.direct.ssh.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * Account entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_ACCOUNT")
public class Account implements java.io.Serializable,com.direct.ssh.domain.Entity {

	// Fields

	private String id;
	private Employee employee;
	private String username;
	private String password;
	private String question1;
	private String question2;
	private String answer1;
	private String answer2;
	private Date lastLoginTime;
	private Integer loginFailCount;
	private Integer valid;

	// Constructors

	/** default constructor */
	public Account() {
	}

	/** minimal constructor */
	public Account(Employee employee) {
		this.employee = employee;
	}

	/** full constructor */
	public Account(Employee employee, String username, String password,
			String question1, String question2, String answer1, String answer2,
			Date lastLoginTime, Integer loginFailCount, Integer valid) {
		this.employee = employee;
		this.username = username;
		this.password = password;
		this.question1 = question1;
		this.question2 = question2;
		this.answer1 = answer1;
		this.answer2 = answer2;
		this.lastLoginTime = lastLoginTime;
		this.loginFailCount = loginFailCount;
		this.valid = valid;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Employee getEmployee() {
		return this.employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	@Column(name = "USERNAME", length = 36)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "PASSWORD", length = 100)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "QUESTION1", length = 100)
	public String getQuestion1() {
		return this.question1;
	}

	public void setQuestion1(String question1) {
		this.question1 = question1;
	}

	@Column(name = "QUESTION2", length = 100)
	public String getQuestion2() {
		return this.question2;
	}

	public void setQuestion2(String question2) {
		this.question2 = question2;
	}

	@Column(name = "ANSWER1", length = 100)
	public String getAnswer1() {
		return this.answer1;
	}

	public void setAnswer1(String answer1) {
		this.answer1 = answer1;
	}

	@Column(name = "ANSWER2", length = 100)
	public String getAnswer2() {
		return this.answer2;
	}

	public void setAnswer2(String answer2) {
		this.answer2 = answer2;
	}

	@Column(name = "LAST_LOGIN_TIME")
	public Date getLastLoginTime() {
		return this.lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	@Column(name = "LOGIN_FAIL_COUNT", precision = 22, scale = 0)
	public Integer getLoginFailCount() {
		return this.loginFailCount;
	}

	public void setLoginFailCount(Integer loginFailCount) {
		this.loginFailCount = loginFailCount;
	}

	@Column(name = "VALID", precision = 22, scale = 0)
	public Integer getValid() {
		return this.valid;
	}

	public void setValid(Integer valid) {
		this.valid = valid;
	}

}